<?php 

class App_Model_Reply extends Ext_Db_Table
{
    
    public function getCount($destArticleId)
    {
        $db = $this->getAdapter();
        $select = $db->select();
        $select
            ->from($this->_dbprefix."reply", array(
               Zend_Paginator_Adapter_DbSelect::ROW_COUNT_COLUMN => 'COUNT(*)'
            ))
            ->where('destArticleId = :destArticleId')
            ;
        $params = array('destArticleId' => $destArticleId);
        $select->bind($params);
        
        return $select;
    }
    
    public function getList($destArticleId)
    {
        $db = $this->getAdapter();
        $select = $db->select();
        $select
            ->from($this->_dbprefix."reply", "articleId")
            ->order('articleId DESC')
            ->where('destArticleId = :destArticleId')
            ;
        $params = array('destArticleId' => $destArticleId);
        $select->bind($params);
        
        return $select;
    }

}